struct ListNode* swapNodes(struct ListNode* head, int k){
    if(head==NULL || head->next == NULL){return head;}
    int size=0,l,r;
    struct ListNode *p=head;
    struct ListNode *q=head;
    while(p){size++;p=p->next;}
    l=k-1;
    r=size-k;
    p=head;
    while(l)
    {
      p=p->next;
      l--; 
    }
    while(r)
    {
      q=q->next;
      r--; 
    }
    int a;
    a=p->val;
    p->val=q->val;
    q->val=a;
    return head;
}
